home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 12 - 1996 / 12.04 Apr 96 / ThreadingAppleEvents.sit / ThreadingAppleEvents / Grant's CGI Code 1.0b13 / Util / PrefUtil.c < prev    next >
MacBinary  |  1995-12-09  |  2.1 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sat Dec 9 11:48:21 1995, modified Sat Dec 9 11:48:21 1995, creator 'CWIE', type ASCII, 1523 bytes "PrefUtil.c" , at 0x673 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 50 72 65 66 55 74 | 69 6c 2e 63 00 00 00 00 |..PrefUt|il.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 05 f3 00 | 00 01 9a ac ef 6e 55 ac |........|.....nU.|
|00000060| ef 6e 55 00 00 04 00 00 | 00 00 00 00 00 00 00 00 |.nU.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 c1 7f 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 0d 20 | 2a 0d 20 2a 09 50 72 65 |/*****. |*. *.Pre|
|00000090| 66 55 74 69 6c 2e 63 0d | 20 2a 0d 20 2a 09 a5 a5 |fUtil.c.| *. *...|
|000000a0| a5 20 54 68 69 73 20 66 | 69 6c 65 20 68 61 73 20 |. This f|ile has |
|000000b0| 68 61 72 64 6c 79 20 62 | 65 67 75 6e 20 61 6e 64 |hardly b|egun and|
|000000c0| 20 64 6f 65 73 6e 27 74 | 20 64 6f 20 61 6e 79 74 | doesn't| do anyt|
|000000d0| 68 69 6e 67 20 79 65 74 | 2e 0d 20 2a 09 09 50 4c |hing yet|.. *..PL|
|000000e0| 45 41 53 45 20 49 47 4e | 4f 52 45 20 54 48 49 53 |EASE IGN|ORE THIS|
|000000f0| 20 46 49 4c 45 20 46 4f | 52 20 4e 4f 57 0d 20 2a | FILE FO|R NOW. *|
|00000100| 0d 20 2a 09 54 68 69 73 | 20 69 73 20 61 20 73 75 |. *.This| is a su|
|00000110| 70 70 6f 72 74 20 66 69 | 6c 65 20 66 6f 72 20 22 |pport fi|le for "|
|00000120| 47 72 61 6e 74 27 73 20 | 43 47 49 20 46 72 61 6d |Grant's |CGI Fram|
|00000130| 65 77 6f 72 6b 22 2e 0d | 20 2a 09 50 6c 65 61 73 |ework"..| *.Pleas|
|00000140| 65 20 73 65 65 20 74 68 | 65 20 6c 69 63 65 6e 73 |e see th|e licens|
|00000150| 65 20 61 67 72 65 65 6d | 65 6e 74 20 74 68 61 74 |e agreem|ent that|
|00000160| 20 61 63 63 6f 6d 70 61 | 6e 69 65 73 20 74 68 65 | accompa|nies the|
|00000170| 20 64 69 73 74 72 69 62 | 75 74 69 6f 6e 20 70 61 | distrib|ution pa|
|00000180| 63 6b 61 67 65 0d 20 2a | 09 66 6f 72 20 6c 69 63 |ckage. *|.for lic|
|00000190| 65 6e 73 69 6e 67 20 64 | 65 74 61 69 6c 73 2e 0d |ensing d|etails..|
|000001a0| 20 2a 0d 20 2a 09 43 6f | 70 79 72 69 67 68 74 20 | *. *.Co|pyright |
|000001b0| a9 31 39 39 35 20 62 79 | 20 47 72 61 6e 74 20 4e |.1995 by| Grant N|
|000001c0| 65 75 66 65 6c 64 0d 20 | 2a 09 67 72 61 6e 74 40 |eufeld. |*.grant@|
|000001d0| 61 63 6d 2e 63 6f 6d 0d | 20 2a 09 68 74 74 70 3a |acm.com.| *.http:|
|000001e0| 2f 2f 61 72 70 70 31 2e | 63 61 72 6c 65 74 6f 6e |//arpp1.|carleton|
|000001f0| 2e 63 61 2f 67 72 61 6e | 74 2f 0d 20 2a 0d 20 2a |.ca/gran|t/. *. *|
|00000200| 2a 2a 2a 2a 2f 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |****/..#|include |
|00000210| 22 63 6f 6d 70 69 6c 65 | 72 5f 73 74 75 66 66 2e |"compile|r_stuff.|
|00000220| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 22 63 6f 6e |h".#incl|ude "con|
|00000230| 73 74 61 6e 74 73 2e 68 | 22 0d 23 69 6e 63 6c 75 |stants.h|".#inclu|
|00000240| 64 65 20 22 67 6c 6f 62 | 61 6c 73 2e 68 22 0d 0d |de "glob|als.h"..|
|00000250| 23 69 6e 63 6c 75 64 65 | 20 22 45 72 72 6f 72 55 |#include| "ErrorU|
|00000260| 74 69 6c 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |til.h".#|include |
|00000270| 22 4d 65 6d 6f 72 79 55 | 74 69 6c 2e 68 22 0d 23 |"MemoryU|til.h".#|
|00000280| 69 6e 63 6c 75 64 65 20 | 22 50 72 6f 63 65 73 73 |include |"Process|
|00000290| 55 74 69 6c 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |Util.h".|#include|
|000002a0| 20 22 53 74 72 69 6e 67 | 55 74 69 6c 2e 68 22 0d | "String|Util.h".|
|000002b0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 50 72 65 66 55 |.#includ|e "PrefU|
|000002c0| 74 69 6c 2e 68 22 0d 0d | 0d 2f 2a 2a 2a 20 20 4c |til.h"..|./*** L|
|000002d0| 4f 43 41 4c 20 56 41 52 | 49 41 42 4c 45 53 20 20 |OCAL VAR|IABLES |
|000002e0| 2a 2a 2a 2f 0d 0d 09 73 | 68 6f 72 74 09 76 50 72 |***/...s|hort.vPr|
|000002f0| 65 66 46 69 6c 65 52 65 | 66 3b 09 2f 2a 20 72 65 |efFileRe|f;./* re|
|00000300| 66 65 72 65 6e 63 65 20 | 6f 66 20 74 68 65 20 6f |ference |of the o|
|00000310| 70 65 6e 20 70 72 65 66 | 65 72 65 6e 63 65 20 66 |pen pref|erence f|
|00000320| 69 6c 65 20 2a 2f 0d 0d | 0d 2f 2a 2a 2a 20 20 46 |ile */..|./*** F|
|00000330| 55 4e 43 54 49 4f 4e 53 | 20 20 2a 2a 2a 2f 0d 0d |UNCTIONS| ***/..|
|00000340| 2f 2a 20 20 2a 2f 0d 76 | 6f 69 64 0d 50 72 65 66 |/* */.v|oid.Pref|
|00000350| 53 74 61 72 74 75 70 20 | 28 20 76 6f 69 64 20 29 |Startup |( void )|
|00000360| 0d 7b 0d 09 0d 7d 20 2f | 2a 20 20 2a 2f 0d 0d 0d |.{...} /|* */...|
|00000370| 2f 2a 2a 20 50 72 65 66 | 73 20 46 69 6c 65 20 41 |/** Pref|s File A|
|00000380| 63 63 65 73 73 20 2a 2a | 2f 0d 23 70 72 61 67 6d |ccess **|/.#pragm|
|00000390| 61 20 6d 61 72 6b 20 2d | 0d 0d 2f 2a 20 53 61 76 |a mark -|../* Sav|
|000003a0| 65 20 74 68 65 20 64 61 | 74 61 20 61 73 20 74 68 |e the da|ta as th|
|000003b0| 65 20 73 70 65 63 69 66 | 69 65 64 20 72 65 73 6f |e specif|ied reso|
|000003c0| 75 72 63 65 20 69 6e 20 | 74 68 65 20 70 72 65 66 |urce in |the pref|
|000003d0| 65 72 65 6e 63 65 73 20 | 66 69 6c 65 2e 0d 09 49 |erences |file...I|
|000003e0| 66 20 74 68 65 20 66 69 | 6c 65 20 64 6f 65 73 6e |f the fi|le doesn|
|000003f0| 27 74 20 65 78 69 73 74 | 20 79 65 74 2c 20 63 72 |'t exist| yet, cr|
|00000400| 65 61 74 65 20 69 74 2e | 20 2a 2f 0d 76 6f 69 64 |eate it.| */.void|
|00000410| 0d 50 72 65 66 53 61 76 | 65 49 74 65 6d 20 28 20 |.PrefSav|eItem ( |
|00000420| 73 68 6f 72 74 20 74 68 | 65 52 65 73 49 44 2c 20 |short th|eResID, |
|00000430| 52 65 73 54 79 70 65 20 | 74 68 65 52 65 73 54 79 |ResType |theResTy|
|00000440| 70 65 2c 20 76 6f 69 64 | 20 2a 74 68 65 44 61 74 |pe, void| *theDat|
|00000450| 61 2c 20 73 68 6f 72 74 | 20 74 68 65 53 69 7a 65 |a, short| theSize|
|00000460| 20 29 0d 7b 0d 09 0d 7d | 20 2f 2a 20 50 72 65 66 | ).{...}| /* Pref|
|00000470| 53 61 76 65 49 74 65 6d | 20 2a 2f 0d 0d 0d 2f 2a |SaveItem| */.../*|
|00000480| 20 43 72 65 61 74 65 20 | 74 68 65 20 70 72 65 66 | Create |the pref|
|00000490| 65 72 65 6e 63 65 73 20 | 66 69 6c 65 2e 20 2a 2f |erences |file. */|
|000004a0| 0d 4f 53 45 72 72 0d 50 | 72 65 66 43 72 65 61 74 |.OSErr.P|refCreat|
|000004b0| 65 46 69 6c 65 20 28 20 | 76 6f 69 64 20 29 0d 7b |eFile ( |void ).{|
|000004c0| 0d 09 4f 53 45 72 72 09 | 74 68 65 45 72 72 3b 0d |..OSErr.|theErr;.|
|000004d0| 09 0d 09 74 68 65 45 72 | 72 20 3d 20 6e 6f 45 72 |...theEr|r = noEr|
|000004e0| 72 3b 20 2f 2f a5 a5 a5 | 0d 09 0d 09 72 65 74 75 |r; //...|....retu|
|000004f0| 72 6e 20 74 68 65 45 72 | 72 3b 0d 7d 20 2f 2a 20 |rn theEr|r;.} /* |
|00000500| 50 72 65 66 43 72 65 61 | 74 65 46 69 6c 65 20 2a |PrefCrea|teFile *|
|00000510| 2f 0d 0d 0d 2f 2a 20 4f | 70 65 6e 20 74 68 65 20 |/.../* O|pen the |
|00000520| 70 72 65 66 65 72 65 6e | 63 65 73 20 66 69 6c 65 |preferen|ces file|
|00000530| 20 61 6e 64 20 73 65 74 | 20 69 74 20 61 73 20 74 | and set| it as t|
|00000540| 68 65 20 63 75 72 72 65 | 6e 74 20 72 65 73 6f 75 |he curre|nt resou|
|00000550| 72 63 65 20 66 69 6c 65 | 2e 20 2a 2f 0d 4f 53 45 |rce file|. */.OSE|
|00000560| 72 72 0d 50 72 65 66 4f | 70 65 6e 46 69 6c 65 20 |rr.PrefO|penFile |
|00000570| 28 20 76 6f 69 64 20 29 | 0d 7b 0d 09 4f 53 45 72 |( void )|.{..OSEr|
|00000580| 72 09 74 68 65 45 72 72 | 3b 0d 09 0d 09 74 68 65 |r.theErr|;....the|
|00000590| 45 72 72 20 3d 20 6e 6f | 45 72 72 3b 20 2f 2f a5 |Err = no|Err; //.|
|000005a0| a5 a5 0d 09 0d 09 72 65 | 74 75 72 6e 20 74 68 65 |......re|turn the|
|000005b0| 45 72 72 3b 0d 7d 20 2f | 2a 20 50 72 65 66 4f 70 |Err;.} /|* PrefOp|
|000005c0| 65 6e 46 69 6c 65 20 2a | 2f 0d 0d 0d 2f 2a 20 43 |enFile *|/.../* C|
|000005d0| 6c 6f 73 65 20 74 68 65 | 20 70 72 65 66 65 72 65 |lose the| prefere|
|000005e0| 6e 63 65 73 20 66 69 6c | 65 2e 20 2a 2f 0d 4f 53 |nces fil|e. */.OS|
|000005f0| 45 72 72 0d 50 72 65 66 | 43 6c 6f 73 65 46 69 6c |Err.Pref|CloseFil|
|00000600| 65 20 28 20 76 6f 69 64 | 20 29 0d 7b 0d 09 4f 53 |e ( void| ).{..OS|
|00000610| 45 72 72 09 74 68 65 45 | 72 72 3b 0d 09 0d 09 74 |Err.theE|rr;....t|
|00000620| 68 65 45 72 72 20 3d 20 | 6e 6f 45 72 72 3b 20 2f |heErr = |noErr; /|
|00000630| 2f a5 a5 a5 0d 09 0d 09 | 72 65 74 75 72 6e 20 74 |/.......|return t|
|00000640| 68 65 45 72 72 3b 0d 7d | 20 2f 2a 20 50 72 65 66 |heErr;.}| /* Pref|
|00000650| 43 6c 6f 73 65 46 69 6c | 65 20 2a 2f 0d 0d 0d 2f |CloseFil|e */.../|
|00000660| 2a 2a 2a 2a 2a 20 20 45 | 4f 46 20 20 2a 2a 2a 2a |***** E|OF ****|
|00000670| 2a 2f 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |*/......|........|
|00000680| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000690| 72 41 45 4e 6f 74 41 70 | 70 6c 65 45 76 65 6e 74 |rAENotAp|pleEvent|
|000006a0| 00 03 89 61 70 70 49 73 | 44 61 65 6d 6f 6e 00 02 |...appIs|Daemon..|
|000006b0| 0a 50 72 65 66 55 74 69 | 6c 2e 63 00 02 00 00 00 |.PrefUti|l.c.....|
|000006c0| 54 45 58 54 43 57 49 45 | 00 04 00 00 00 00 00 00 |TEXTCWIE|........|
|000006d0| 00 00 54 45 58 54 43 57 | 49 45 00 04 00 00 00 00 |..TEXTCW|IE......|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 ac 5b db cf 00 00 | 00 00 00 00 01 9a 6f 6e |...[....|......on|
|00000700| 00 02 5b 42 49 54 4d 41 | 50 54 4f 52 45 47 49 4f |..[BITMA|PTOREGIO|
|00000710| 4e 00 00 c7 51 44 47 6c | 6f 62 61 6c 73 48 64 6c |N...QDGl|obalsHdl|
|00000720| 00 03 b3 74 72 61 6e 73 | 70 61 72 65 6e 74 00 01 |...trans|parent..|
|00000730| 7d 6e 6f 74 50 61 74 58 | 6f 72 00 02 71 70 61 74 |}notPatX|or..qpat|
|00000740| 58 6f 72 00 01 5f 56 69 | 73 69 62 6c 65 4c 65 6e |Xor.._Vi|sibleLen|
|00000750| 67 74 68 00 01 c8 56 49 | 53 49 42 4c 45 4c 45 4e |gth...VI|SIBLELEN|
|00000760| 47 54 48 00 01 e7 74 6f | 67 67 6c 65 55 6e 6b 6e |GTH...to|ggleUnkn|
|00000770| 6f 77 6e 00 02 b0 65 6e | 76 50 72 74 62 6c 41 44 |own...en|vPrtblAD|
|00000780| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 03 | 00 04 00 57 00 05 01 b4 |........|...W....|
|000007b0| 02 19 00 57 00 05 01 b4 | 02 19 ac ef 27 5c 00 00 |...W....|....'\..|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 00 04 |........|........|
|000007d0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000007e0| 00 00 00 46 00 99 36 ac | 22 86 00 00 00 1c 00 46 |...F..6.|"......F|
|000007f0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00000800| 00 1e 03 ed ff ff 00 00 | 00 00 00 99 35 cc 03 f0 |........|....5...|
|00000810| ff ff 00 00 00 4c 00 99 | 35 c4 00 00 00 00 00 00 |.....L..|5.......|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+